import pytest

import config
# from api.login import login
from api.order import Order
from common.utils import assert_common, read_json_file


class TestLogin:
    def setup_class(self):
        self.order_api = Order()
    @pytest.mark.parametrize("username,password,status,er,esg",read_json_file(f"{config.BASE_DIR}./data/login.json"))
    def test_login01(self,username,password,status,er,esg):
        # 1.登录接口
        response = self.order_api.order_login(username, password)
        print(response.json())
        # 2.断言
        assert_common(response,status,er,esg)